fix: unlock font-size field for global editing without selection - #876
Open
JoeJoeflyn wants to merge 1 commit into
Open
fix: unlock font-size field for global editing without selection#876JoeJoeflyn wants to merge 1 commit into
JoeJoeflyn wants to merge 1 commit into
Conversation
JoeJoeflyn
requested review from
Map1en,
fffonion,
karrot0,
liksunrice and
mayocream
as code owners
July 26, 2026 17:58
Contributor
|
Thanks for your first PR to Koharu. Please review our contribution guide before review: In the PR description, include:
If AI helped produce the patch, a human still needs to review and understand it before submission. |
The font-size input, increment, and decrement buttons were disabled unless a text node was selected, blocking the global workflow: typing a value with nothing selected should apply to every text box on the page, and clearing it should reset all boxes to auto. What changed: - Switch the disabled guard from !selectedNode to !hasNodes so the controls stay enabled whenever the page has text boxes. - Route commits through applyStyleToSelected when a node is selected and applyStyleToAll otherwise, so the existing per-node behavior is preserved. - Buffer the input in local state (globalFontSizeInput) while in global scope, otherwise the controlled value resets to '' on each keystroke because currentFontSize stays undefined with no selection. User-visible behavior differences: - With no text node selected, the font-size field is now editable (previously greyed out). Typing a number applies it to every text box on the page; clearing the field resets all boxes to auto. - Selecting a single text box still applies changes only to that node, unchanged. How I verified: - bun run format and bun run test:ui (158/158 passed, including new tests covering the global behavior). - Manually confirmed against a running app: with no text node selected, typing 24 sets fontSize=24 on all 8 text boxes; clearing the field reverts all to auto (null) in the backend scene. Closes mayocream#649. This patch was made with AI assistance (Devin/Claude). The code was reviewed and tested before submission.
JoeJoeflyn
force-pushed
the
fix/global-font-size-control
branch
from
July 26, 2026 18:02
c829991 to
33eb784
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The font-size input, increment, and decrement buttons were disabled unless a text node was selected. This blocked the global workflow: typing a value with nothing selected should apply to every text box on the page, and clearing it should reset all boxes to auto.
What changed: The disabled guard now checks
hasNodesinstead ofselectedNode, so the controls stay enabled whenever the page has text boxes. Commits route throughapplyStyleToSelectedwhen a node is selected andapplyStyleToAllotherwise, preserving the existing per-node behavior. A local state buffer (globalFontSizeInput) holds the input value in global scope, otherwise the controlled value resets to''on each keystroke becausecurrentFontSizestays undefined with no selection.User-visible behavior differences: With no text node selected, the font-size field is now editable (previously greyed out). Typing a number applies it to every text box on the page; clearing the field resets all boxes to auto. Selecting a single text box still applies changes only to that node, unchanged.
How I verified:
bun run formatandbun run test:ui(158/158 passed, including new tests covering the global behavior). Manually confirmed against a running app: with no text node selected, typing24setsfontSize=24on all 8 text boxes; clearing the field reverts all toauto(null) in the backend scene.Fixes: #649
This patch was made with AI assistance (Devin/Claude). The code was reviewed and tested before submission.
screenrecording-2026-07-27_00-50-21.mp4